@import '../mixin.scss';

@include namespace(input) {
    -webkit-appearance: none;
    background-color: #fff;
    background-image: none;
    border-radius: 4px;
    border: 1px solid #dcdfe6;
    box-sizing: border-box;
    color: #606266;
    display: inline-block;
    font-size: inherit;
    height: 40px;
    line-height: 40px;
    outline: none;
    padding: 0 15px;
    transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
    width: 100%;

    @include when(prepend){
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }

    @include when(append){
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    &:focus {
        outline: none;
        border-color: #409eff;
    }

    &--outer {
        position: relative;
    }

    &--suffix {
        position: absolute;
        height: 100%;
        top: 0;
        right: 5px;
        text-align: center;
        color: #c0c4cc;
        cursor: pointer;
        &:hover {
            color: #333;
        }
    }

    &__icon {
        height: 100%;
        width: 25px;
        text-align: center;
        -webkit-transition: all .3s;
        transition: all .3s;
        line-height: 40px
    }

    &__prepend,
    &__append {
        background-color: #f5f7fa;
        color: #909399;
        vertical-align: middle;
        display: table-cell;
        position: relative;
        border: 1px solid #dcdfe6;
        border-radius: 4px;
        padding: 0 20px;
        white-space: nowrap;
        width: 1px;
    }

    &__prepend {
        border-right: 0;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    &__append {
        border-left: 0;
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
}

@include namespace(textarea) {
    display: block;
    resize: vertical;
    padding: 5px 15px;
    line-height: 1.5;
    box-sizing: border-box;
    width: 100%;
    font-size: inherit;
    color: #606266;
    background-color: #fff;
    background-image: none;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    transition: border-color .2s cubic-bezier(.645, .045, .355, 1);

    &:focus {
        outline: none;
        border-color: #409eff;
    }


}